<template>
  <h1>{{ msg }}</h1>
  <el-button @click="handleClick"> element中的按钮 </el-button>
  <div>{{ store.state.name }}</div>
  <el-button type="primary" @click="handleRouter"> 测试路由的跳转 </el-button>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import store from '@/store'

defineProps<{ msg: string }>()

const route = useRoute()
const router = useRouter()

const handleClick = () => {
    store.commit('setName', '尝试改变store中name的值')
}
const handleRouter = () => {
    router.push('/axios')
}
const count = ref(0)
</script>
<style scoped>
.read-the-docs {
  color: #888;
}
</style>
